package com.javasee.rain.stock;


import com.javasee.common.dbsharding.DbShardingContextHolder;

import com.javasee.rain.stock.model.Zhishu;
import com.javasee.rain.stock.mapper.ZhishuMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Project Name:
 * File Name   :
 * Package Name:
 *
 * @author : xinyanfei
 * @date :
 * Copyright (c) , 京东商城  All Rights Reserved.
 */
@Slf4j
@RestController
public class DbController {

    @Autowired
    private ZhishuMapper zhishuMapper;


    @ResponseBody
    @GetMapping("/db/users")
    public Result getUsersMapper() {
//        DbShardingContextHolder.single("zhishu");

        List<Zhishu> data = zhishuMapper.selectByDate("2025-09-25");
        System.out.println("usersMapper.findAll() = " + data);

        return Result.builder().build(data).setState(Result.success);
    }


}

